{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import os\n",
    "\n",
    "import numpy as np\n",
    "import pandas as pd\n",
    "import plotly.graph_objects as go\n",
    "from plotly.subplots import make_subplots\n",
    "from plotly_resampler import unregister_plotly_resampler\n",
    "\n",
    "from neuralprophet import NeuralProphet, set_log_level\n",
    "\n",
    "set_log_level(\"INFO\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "def create_metrics_plot(metrics):\n",
    "    # Deactivate the resampler since it is not compatible with kaleido (image export)\n",
    "    unregister_plotly_resampler()\n",
    "\n",
    "    # Plotly params\n",
    "    prediction_color = \"#2d92ff\"\n",
    "    actual_color = \"black\"\n",
    "    line_width = 2\n",
    "    xaxis_args = {\"showline\": True, \"mirror\": True, \"linewidth\": 1.5, \"showgrid\": False}\n",
    "    yaxis_args = {\n",
    "        \"showline\": True,\n",
    "        \"mirror\": True,\n",
    "        \"linewidth\": 1.5,\n",
    "        \"showgrid\": False,\n",
    "        \"rangemode\": \"tozero\",\n",
    "        \"type\": \"log\",\n",
    "    }\n",
    "    layout_args = {\n",
    "        \"autosize\": True,\n",
    "        \"template\": \"plotly_white\",\n",
    "        \"margin\": go.layout.Margin(l=0, r=10, b=0, t=30, pad=0),\n",
    "        \"font\": dict(size=10),\n",
    "        \"title\": dict(font=dict(size=10)),\n",
    "        \"width\": 1000,\n",
    "        \"height\": 200,\n",
    "    }\n",
    "\n",
    "    metric_cols = [col for col in metrics.columns if not (\"_val\" in col or col == \"RegLoss\" or col == \"epoch\")]\n",
    "    fig = make_subplots(rows=1, cols=len(metric_cols), subplot_titles=metric_cols)\n",
    "    for i, metric in enumerate(metric_cols):\n",
    "        fig.add_trace(\n",
    "            go.Scatter(\n",
    "                y=metrics[metric],\n",
    "                name=metric,\n",
    "                mode=\"lines\",\n",
    "                line=dict(color=prediction_color, width=line_width),\n",
    "                legendgroup=metric,\n",
    "            ),\n",
    "            row=1,\n",
    "            col=i + 1,\n",
    "        )\n",
    "        if f\"{metric}_val\" in metrics.columns:\n",
    "            fig.add_trace(\n",
    "                go.Scatter(\n",
    "                    y=metrics[f\"{metric}_val\"],\n",
    "                    name=f\"{metric}_val\",\n",
    "                    mode=\"lines\",\n",
    "                    line=dict(color=actual_color, width=line_width),\n",
    "                    legendgroup=metric,\n",
    "                ),\n",
    "                row=1,\n",
    "                col=i + 1,\n",
    "            )\n",
    "        if metric == \"Loss\":\n",
    "            fig.add_trace(\n",
    "                go.Scatter(\n",
    "                    y=metrics[\"RegLoss\"],\n",
    "                    name=\"RegLoss\",\n",
    "                    mode=\"lines\",\n",
    "                    line=dict(color=actual_color, width=line_width),\n",
    "                    legendgroup=metric,\n",
    "                ),\n",
    "                row=1,\n",
    "                col=i + 1,\n",
    "            )\n",
    "    fig.update_xaxes(xaxis_args)\n",
    "    fig.update_yaxes(yaxis_args)\n",
    "    fig.update_layout(layout_args)\n",
    "    return fig"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "DIR = \"~/github/neural_prophet\"\n",
    "DATA_DIR = os.path.join(DIR, \"tests\", \"test-data\")\n",
    "PEYTON_FILE = os.path.join(DATA_DIR, \"wp_log_peyton_manning.csv\")\n",
    "AIR_FILE = os.path.join(DATA_DIR, \"air_passengers.csv\")\n",
    "YOS_FILE = os.path.join(DATA_DIR, \"yosemite_temps.csv\")\n",
    "ENERGY_PRICE_DAILY_FILE = os.path.join(DATA_DIR, \"tutorial04_kaggle_energy_daily_temperature.csv\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "df = pd.read_csv(ENERGY_PRICE_DAILY_FILE)\n",
    "df[\"temp\"] = df[\"temperature\"]\n",
    "df = df.drop(columns=\"temperature\")\n",
    "df[\"ds\"] = pd.to_datetime(df[\"ds\"])\n",
    "df[\"y\"] = pd.to_numeric(df[\"y\"], errors=\"coerce\")\n",
    "\n",
    "df = df.drop(\"ds\", axis=1)\n",
    "df[\"ds\"] = pd.date_range(start=\"2015-01-01 00:00:00\", periods=len(df), freq=\"h\")\n",
    "df[\"ID\"] = \"test\"\n",
    "\n",
    "df_id = df[[\"ds\", \"y\", \"temp\"]].copy()\n",
    "df_id[\"ID\"] = \"test2\"\n",
    "df_id[\"y\"] = df_id[\"y\"] * 0.3\n",
    "df_id[\"temp\"] = df_id[\"temp\"] * 0.4\n",
    "df = pd.concat([df, df_id], ignore_index=True)\n",
    "\n",
    "# Conditional Seasonality\n",
    "df[\"winter\"] = np.where(\n",
    "    df[\"ds\"].dt.month.isin([1]),\n",
    "    1,\n",
    "    0,\n",
    ")\n",
    "df[\"summer\"] = np.where(df[\"ds\"].dt.month.isin([2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]), 1, 0)\n",
    "df[\"winter\"] = pd.to_numeric(df[\"winter\"], errors=\"coerce\")\n",
    "df[\"summer\"] = pd.to_numeric(df[\"summer\"], errors=\"coerce\")\n",
    "\n",
    "# Normalize Temperature\n",
    "df[\"temp\"] = (df[\"temp\"] - 65.0) / 50.0\n",
    "\n",
    "# df\n",
    "df = df[[\"ID\", \"ds\", \"y\", \"temp\", \"winter\", \"summer\"]]\n",
    "\n",
    "# Split\n",
    "df_train = df[df[\"ds\"] < \"2015-03-01\"]\n",
    "df_test = df[df[\"ds\"] >= \"2015-03-01\"]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "quantiles: [0.01, 0.99]\n",
      "Using CPU\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "<neuralprophet.forecaster.NeuralProphet at 0x74f53b333610>"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "# Hyperparameter\n",
    "tuned_params = {\n",
    "    \"n_lags\": 10,\n",
    "    \"newer_samples_weight\": 2.0,\n",
    "    \"n_changepoints\": 0,\n",
    "    \"yearly_seasonality\": 10,\n",
    "    \"weekly_seasonality\": True,\n",
    "    \"daily_seasonality\": False,  # due to conditional daily seasonality\n",
    "    \"batch_size\": 32,\n",
    "    \"ar_layers\": [8, 4],\n",
    "    \"lagged_reg_layers\": [8],\n",
    "    # not tuned\n",
    "    \"n_forecasts\": 5,\n",
    "    # \"learning_rate\": 0.1,\n",
    "    \"epochs\": 10,\n",
    "    \"trend_global_local\": \"global\",\n",
    "    \"season_global_local\": \"global\",\n",
    "    \"drop_missing\": True,\n",
    "    \"normalize\": \"standardize\",\n",
    "}\n",
    "\n",
    "# Uncertainty Quantification\n",
    "confidence_lv = 0.98\n",
    "quantile_list = [round(((1 - confidence_lv) / 2), 2), round((confidence_lv + (1 - confidence_lv) / 2), 2)]\n",
    "# quantile_list = None\n",
    "print(f\"quantiles: {quantile_list}\")\n",
    "\n",
    "# Check if GPU is available\n",
    "# use_gpu = torch.cuda.is_available()\n",
    "use_gpu = False\n",
    "\n",
    "# Set trainer configuration\n",
    "trainer_configs = {\n",
    "    \"accelerator\": \"gpu\" if use_gpu else \"cpu\",\n",
    "}\n",
    "print(f\"Using {'GPU' if use_gpu else 'CPU'}\")\n",
    "\n",
    "# Model\n",
    "m = NeuralProphet(**tuned_params, **trainer_configs, quantiles=quantile_list)\n",
    "\n",
    "# Lagged Regressor\n",
    "m.add_lagged_regressor(names=\"temp\", n_lags=33, normalize=\"standardize\")\n",
    "\n",
    "# Conditional Seasonality\n",
    "m.add_seasonality(name=\"winter\", period=1, fourier_order=6, condition_name=\"winter\")\n",
    "m.add_seasonality(name=\"summer\", period=1, fourier_order=6, condition_name=\"summer\")\n",
    "\n",
    "# Holidays\n",
    "m.add_country_holidays(country_name=\"US\", lower_window=-1, upper_window=1)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO - (NP.forecaster.fit) - When Global modeling with local normalization, metrics are displayed in normalized scale.\n",
      "WARNING - (NP.forecaster.fit) - Metrics are enabled. Please provide valid metrics logging directory. Setting to CWD\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.929% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.929% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning: Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "  converted_ds = pd.to_datetime(ds_col, utc=True).view(dtype=np.int64)\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "  contains_nan = torch.cat([torch.tensor(contains_nan), torch.ones(n_forecasts, dtype=torch.bool)])\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "  contains_nan = torch.cat([torch.tensor(contains_nan), torch.ones(n_forecasts, dtype=torch.bool)])\n",
      "\n",
      "INFO - (NP.forecaster._train) - Dataset size: 2758\n",
      "INFO - (NP.forecaster._train) - Number of batches per training epoch: 87\n",
      "INFO - (NP.utils.configure_trainer) - Using accelerator cpu with 1 device(s).\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "ded17dc7d6e940bfb29321cd972603b6",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Training: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO - (NP.forecaster._train) - No Learning Rate provided. Activating learning rate finder\n",
      "WARNING - (NP.config.set_lr_finder_args) - Learning rate finder: The number of batches per epoch (87) is too small than the required number                     for the learning rate finder (127). The results might not be optimal.\n",
      "INFO - (NP.forecaster._train) - Learning rate finder ---- ARGs: {'min_lr': 1e-07, 'max_lr': 10.0, 'num_training': 127, 'early_stop_threshold': None, 'mode': 'exponential'}\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5c81445c09e94d1f94a5e2a46d3b581f",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Finding best initial lr:   0%|          | 0/127 [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/pytorch_lightning/utilities/data.py:78: Trying to infer the `batch_size` from an ambiguous collection. The batch size we found is 32. To avoid any miscalculations, use `self.log(..., batch_size=batch_size)`.\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/pytorch_lightning/utilities/data.py:78: Trying to infer the `batch_size` from an ambiguous collection. The batch size we found is 6. To avoid any miscalculations, use `self.log(..., batch_size=batch_size)`.\n",
      "\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- default suggestion: 0.012657915866672028\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- steepest: 0.009470610000772239\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- minimum (not used): 1e-07\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- log-avg: 0.010948889651276864\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- returning: 0.010948889651276864\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- LR (start): [1e-07, 1.336547050891115e-07, 1.5451703926941467e-07, 1.7863580192457368e-07, 2.0651929314796276e-07]\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- LR (end): [5.597981979123278, 6.4717781594068, 7.481966305138837, 8.649836012976683, 10.0]\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- LOSS (start): [1.4179426 1.4179426 1.4179426 1.4179426 1.4179426]\n",
      "INFO - (NP.utils.smooth_loss_and_suggest) - Learning rate finder ---- LOSS (end): [7.60549962 7.60549962 7.60549962 7.60549962 7.60549962]\n",
      "INFO - (NP.forecaster._train) - Learning rate finder suggested learning rate: 0.010948889651276864\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "  contains_nan = torch.cat([torch.tensor(contains_nan), torch.ones(n_forecasts, dtype=torch.bool)])\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning: To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "  contains_nan = torch.cat([torch.tensor(contains_nan), torch.ones(n_forecasts, dtype=torch.bool)])\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "201487558461464a9c3a76f239fc7c8c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Training: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/torch/optim/lr_scheduler.py:232: UserWarning: The epoch parameter in `scheduler.step()` was not necessary and is being deprecated where possible. Please use `scheduler.step()` to step the scheduler. During the deprecation, if epoch is different from None, the closed form is used instead of the new chainable form, where available. Please open an issue if you are unable to replicate your use case: https://github.com/pytorch/pytorch/issues/new/choose.\n",
      "  warnings.warn(EPOCH_DEPRECATION_WARNING, UserWarning)\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "18d304212b4f4c278749a2f0d5335876",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "320d6d765a1c4c9a86879955b54fb42d",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "d51845ac98fa449ba2d44535f83e4184",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "15ab6fc0971e4c4292775f022cd79da3",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "39915efe2c3b4a5da50ef1b905a03839",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "95800b53500944f0a30107fe3a635d6c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "3e4ebc050079433299bff044c8b4726b",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "5b5857438fe24f7382e3683a2c81c49c",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "56f0f9e8dc2c4ab2881ac5f736ea2285",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "76602a30b5f94d9ba1fdbe682a8e5e39",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Validation: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# Training & Predict\n",
    "metrics = m.fit(\n",
    "    df=df_train,\n",
    "    validation_df=df_test,\n",
    "    freq=\"h\",\n",
    "    early_stopping=False,\n",
    "    # scheduler=\"onecyclelr\",\n",
    "    # scheduler_args={\n",
    "    #     \"pct_start\": 0.3,\n",
    "    #     \"div_factor\": 100.0,\n",
    "    #     \"final_div_factor\": 1000.0,\n",
    "    #     \"anneal_strategy\": \"cos\",\n",
    "    #     \"three_phase\": False,\n",
    "    # },\n",
    "    # scheduler=\"exponentiallr\",\n",
    "    # scheduler_args={\"gamma\": 0.8,},\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "application/vnd.plotly.v1+json": {
       "config": {
        "plotlyServerURL": "https://plot.ly"
       },
       "data": [
        {
         "legendgroup": "MAE",
         "line": {
          "color": "#2d92ff",
          "width": 2
         },
         "mode": "lines",
         "name": "MAE",
         "type": "scatter",
         "xaxis": "x",
         "y": [
          1.0717755556106567,
          0.5511327981948853,
          0.4953157603740692,
          0.4818778932094574,
          0.4735223650932312,
          0.4717530012130738,
          0.4704058766365051,
          0.4707088768482208,
          0.469352513551712,
          0.468860924243927
         ],
         "yaxis": "y"
        },
        {
         "legendgroup": "MAE",
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "MAE_val",
         "type": "scatter",
         "xaxis": "x",
         "y": [
          0.5182198286056519,
          0.5441035628318787,
          0.47900277376174927,
          0.5163846015930176,
          0.4929402470588684,
          0.5097485780715942,
          0.5129396915435791,
          0.5079220533370972,
          0.5094015002250671,
          0.5108088850975037
         ],
         "yaxis": "y"
        },
        {
         "legendgroup": "RMSE",
         "line": {
          "color": "#2d92ff",
          "width": 2
         },
         "mode": "lines",
         "name": "RMSE",
         "type": "scatter",
         "xaxis": "x2",
         "y": [
          1.3691433668136597,
          0.7346274256706238,
          0.6665279269218445,
          0.6506426334381104,
          0.6393488049507141,
          0.6376363039016724,
          0.6363534331321716,
          0.6357880234718323,
          0.6352851986885071,
          0.6348727941513062
         ],
         "yaxis": "y2"
        },
        {
         "legendgroup": "RMSE",
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "RMSE_val",
         "type": "scatter",
         "xaxis": "x2",
         "y": [
          0.618143618106842,
          0.6197627186775208,
          0.555190920829773,
          0.5922481417655945,
          0.5693594813346863,
          0.5874571204185486,
          0.5925166010856628,
          0.5866028666496277,
          0.588126540184021,
          0.5891289114952087
         ],
         "yaxis": "y2"
        },
        {
         "legendgroup": "Loss",
         "line": {
          "color": "#2d92ff",
          "width": 2
         },
         "mode": "lines",
         "name": "Loss",
         "type": "scatter",
         "xaxis": "x3",
         "y": [
          1.1767247915267944,
          0.36462634801864624,
          0.3093106746673584,
          0.29513803124427795,
          0.2881109416484833,
          0.2860604524612427,
          0.2844979465007782,
          0.2839355170726776,
          0.28298255801200867,
          0.2833350598812103
         ],
         "yaxis": "y3"
        },
        {
         "legendgroup": "Loss",
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "Loss_val",
         "type": "scatter",
         "xaxis": "x3",
         "y": [
          0.4635086953639984,
          0.4854629635810852,
          0.39425128698349,
          0.4356289505958557,
          0.40521177649497986,
          0.4225311279296875,
          0.4251018166542053,
          0.4184044301509857,
          0.4201345443725586,
          0.420722633600235
         ],
         "yaxis": "y3"
        },
        {
         "legendgroup": "Loss",
         "line": {
          "color": "black",
          "width": 2
         },
         "mode": "lines",
         "name": "RegLoss",
         "type": "scatter",
         "xaxis": "x3",
         "y": [
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0,
          0
         ],
         "yaxis": "y3"
        },
        {
         "legendgroup": "LR",
         "line": {
          "color": "#2d92ff",
          "width": 2
         },
         "mode": "lines",
         "name": "LR",
         "type": "scatter",
         "xaxis": "x4",
         "y": [
          0.0028570329304784536,
          0.009130113758146765,
          0.00918674748390913,
          0.0029136640951037407,
          0.001063643372617662,
          0.0008884650305844843,
          0.0006039389409124851,
          0.00031874445267021656,
          0.00014181611186359078,
          0.00014073456986807287
         ],
         "yaxis": "y4"
        }
       ],
       "layout": {
        "annotations": [
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "MAE",
          "x": 0.10625,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "RMSE",
          "x": 0.36875,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "Loss",
          "x": 0.6312500000000001,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         },
         {
          "font": {
           "size": 16
          },
          "showarrow": false,
          "text": "LR",
          "x": 0.89375,
          "xanchor": "center",
          "xref": "paper",
          "y": 1,
          "yanchor": "bottom",
          "yref": "paper"
         }
        ],
        "autosize": true,
        "font": {
         "size": 10
        },
        "height": 200,
        "margin": {
         "b": 0,
         "l": 0,
         "pad": 0,
         "r": 10,
         "t": 30
        },
        "template": {
         "data": {
          "bar": [
           {
            "error_x": {
             "color": "#2a3f5f"
            },
            "error_y": {
             "color": "#2a3f5f"
            },
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "bar"
           }
          ],
          "barpolar": [
           {
            "marker": {
             "line": {
              "color": "white",
              "width": 0.5
             },
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "barpolar"
           }
          ],
          "carpet": [
           {
            "aaxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "baxis": {
             "endlinecolor": "#2a3f5f",
             "gridcolor": "#C8D4E3",
             "linecolor": "#C8D4E3",
             "minorgridcolor": "#C8D4E3",
             "startlinecolor": "#2a3f5f"
            },
            "type": "carpet"
           }
          ],
          "choropleth": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "choropleth"
           }
          ],
          "contour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "contour"
           }
          ],
          "contourcarpet": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "contourcarpet"
           }
          ],
          "heatmap": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmap"
           }
          ],
          "heatmapgl": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "heatmapgl"
           }
          ],
          "histogram": [
           {
            "marker": {
             "pattern": {
              "fillmode": "overlay",
              "size": 10,
              "solidity": 0.2
             }
            },
            "type": "histogram"
           }
          ],
          "histogram2d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2d"
           }
          ],
          "histogram2dcontour": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "histogram2dcontour"
           }
          ],
          "mesh3d": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "type": "mesh3d"
           }
          ],
          "parcoords": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "parcoords"
           }
          ],
          "pie": [
           {
            "automargin": true,
            "type": "pie"
           }
          ],
          "scatter": [
           {
            "fillpattern": {
             "fillmode": "overlay",
             "size": 10,
             "solidity": 0.2
            },
            "type": "scatter"
           }
          ],
          "scatter3d": [
           {
            "line": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatter3d"
           }
          ],
          "scattercarpet": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattercarpet"
           }
          ],
          "scattergeo": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergeo"
           }
          ],
          "scattergl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattergl"
           }
          ],
          "scattermapbox": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scattermapbox"
           }
          ],
          "scatterpolar": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolar"
           }
          ],
          "scatterpolargl": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterpolargl"
           }
          ],
          "scatterternary": [
           {
            "marker": {
             "colorbar": {
              "outlinewidth": 0,
              "ticks": ""
             }
            },
            "type": "scatterternary"
           }
          ],
          "surface": [
           {
            "colorbar": {
             "outlinewidth": 0,
             "ticks": ""
            },
            "colorscale": [
             [
              0,
              "#0d0887"
             ],
             [
              0.1111111111111111,
              "#46039f"
             ],
             [
              0.2222222222222222,
              "#7201a8"
             ],
             [
              0.3333333333333333,
              "#9c179e"
             ],
             [
              0.4444444444444444,
              "#bd3786"
             ],
             [
              0.5555555555555556,
              "#d8576b"
             ],
             [
              0.6666666666666666,
              "#ed7953"
             ],
             [
              0.7777777777777778,
              "#fb9f3a"
             ],
             [
              0.8888888888888888,
              "#fdca26"
             ],
             [
              1,
              "#f0f921"
             ]
            ],
            "type": "surface"
           }
          ],
          "table": [
           {
            "cells": {
             "fill": {
              "color": "#EBF0F8"
             },
             "line": {
              "color": "white"
             }
            },
            "header": {
             "fill": {
              "color": "#C8D4E3"
             },
             "line": {
              "color": "white"
             }
            },
            "type": "table"
           }
          ]
         },
         "layout": {
          "annotationdefaults": {
           "arrowcolor": "#2a3f5f",
           "arrowhead": 0,
           "arrowwidth": 1
          },
          "autotypenumbers": "strict",
          "coloraxis": {
           "colorbar": {
            "outlinewidth": 0,
            "ticks": ""
           }
          },
          "colorscale": {
           "diverging": [
            [
             0,
             "#8e0152"
            ],
            [
             0.1,
             "#c51b7d"
            ],
            [
             0.2,
             "#de77ae"
            ],
            [
             0.3,
             "#f1b6da"
            ],
            [
             0.4,
             "#fde0ef"
            ],
            [
             0.5,
             "#f7f7f7"
            ],
            [
             0.6,
             "#e6f5d0"
            ],
            [
             0.7,
             "#b8e186"
            ],
            [
             0.8,
             "#7fbc41"
            ],
            [
             0.9,
             "#4d9221"
            ],
            [
             1,
             "#276419"
            ]
           ],
           "sequential": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ],
           "sequentialminus": [
            [
             0,
             "#0d0887"
            ],
            [
             0.1111111111111111,
             "#46039f"
            ],
            [
             0.2222222222222222,
             "#7201a8"
            ],
            [
             0.3333333333333333,
             "#9c179e"
            ],
            [
             0.4444444444444444,
             "#bd3786"
            ],
            [
             0.5555555555555556,
             "#d8576b"
            ],
            [
             0.6666666666666666,
             "#ed7953"
            ],
            [
             0.7777777777777778,
             "#fb9f3a"
            ],
            [
             0.8888888888888888,
             "#fdca26"
            ],
            [
             1,
             "#f0f921"
            ]
           ]
          },
          "colorway": [
           "#636efa",
           "#EF553B",
           "#00cc96",
           "#ab63fa",
           "#FFA15A",
           "#19d3f3",
           "#FF6692",
           "#B6E880",
           "#FF97FF",
           "#FECB52"
          ],
          "font": {
           "color": "#2a3f5f"
          },
          "geo": {
           "bgcolor": "white",
           "lakecolor": "white",
           "landcolor": "white",
           "showlakes": true,
           "showland": true,
           "subunitcolor": "#C8D4E3"
          },
          "hoverlabel": {
           "align": "left"
          },
          "hovermode": "closest",
          "mapbox": {
           "style": "light"
          },
          "paper_bgcolor": "white",
          "plot_bgcolor": "white",
          "polar": {
           "angularaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           },
           "bgcolor": "white",
           "radialaxis": {
            "gridcolor": "#EBF0F8",
            "linecolor": "#EBF0F8",
            "ticks": ""
           }
          },
          "scene": {
           "xaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "yaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           },
           "zaxis": {
            "backgroundcolor": "white",
            "gridcolor": "#DFE8F3",
            "gridwidth": 2,
            "linecolor": "#EBF0F8",
            "showbackground": true,
            "ticks": "",
            "zerolinecolor": "#EBF0F8"
           }
          },
          "shapedefaults": {
           "line": {
            "color": "#2a3f5f"
           }
          },
          "ternary": {
           "aaxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "baxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           },
           "bgcolor": "white",
           "caxis": {
            "gridcolor": "#DFE8F3",
            "linecolor": "#A2B1C6",
            "ticks": ""
           }
          },
          "title": {
           "x": 0.05
          },
          "xaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          },
          "yaxis": {
           "automargin": true,
           "gridcolor": "#EBF0F8",
           "linecolor": "#EBF0F8",
           "ticks": "",
           "title": {
            "standoff": 15
           },
           "zerolinecolor": "#EBF0F8",
           "zerolinewidth": 2
          }
         }
        },
        "title": {
         "font": {
          "size": 10
         }
        },
        "width": 1000,
        "xaxis": {
         "anchor": "y",
         "domain": [
          0,
          0.2125
         ],
         "linewidth": 1.5,
         "mirror": true,
         "showgrid": false,
         "showline": true
        },
        "xaxis2": {
         "anchor": "y2",
         "domain": [
          0.2625,
          0.475
         ],
         "linewidth": 1.5,
         "mirror": true,
         "showgrid": false,
         "showline": true
        },
        "xaxis3": {
         "anchor": "y3",
         "domain": [
          0.525,
          0.7375
         ],
         "linewidth": 1.5,
         "mirror": true,
         "showgrid": false,
         "showline": true
        },
        "xaxis4": {
         "anchor": "y4",
         "domain": [
          0.7875,
          1
         ],
         "linewidth": 1.5,
         "mirror": true,
         "showgrid": false,
         "showline": true
        },
        "yaxis": {
         "anchor": "x",
         "domain": [
          0,
          1
         ],
         "linewidth": 1.5,
         "mirror": true,
         "rangemode": "tozero",
         "showgrid": false,
         "showline": true,
         "type": "log"
        },
        "yaxis2": {
         "anchor": "x2",
         "domain": [
          0,
          1
         ],
         "linewidth": 1.5,
         "mirror": true,
         "rangemode": "tozero",
         "showgrid": false,
         "showline": true,
         "type": "log"
        },
        "yaxis3": {
         "anchor": "x3",
         "domain": [
          0,
          1
         ],
         "linewidth": 1.5,
         "mirror": true,
         "rangemode": "tozero",
         "showgrid": false,
         "showline": true,
         "type": "log"
        },
        "yaxis4": {
         "anchor": "x4",
         "domain": [
          0,
          1
         ],
         "linewidth": 1.5,
         "mirror": true,
         "rangemode": "tozero",
         "showgrid": false,
         "showline": true,
         "type": "log"
        }
       }
      }
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "create_metrics_plot(metrics)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "{'MAE_val': 0.5108088850975037,\n",
       " 'RMSE_val': 0.5891289114952087,\n",
       " 'Loss_val': 0.420722633600235,\n",
       " 'RegLoss_val': 0.0,\n",
       " 'epoch': 9,\n",
       " 'MAE': 0.468860924243927,\n",
       " 'RMSE': 0.6348727941513062,\n",
       " 'Loss': 0.2833350598812103,\n",
       " 'RegLoss': 0.0,\n",
       " 'LR': 0.00014073456986807287}"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics.to_dict(\"records\")[-1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>MAE_val</th>\n",
       "      <th>RMSE_val</th>\n",
       "      <th>Loss_val</th>\n",
       "      <th>RegLoss_val</th>\n",
       "      <th>epoch</th>\n",
       "      <th>MAE</th>\n",
       "      <th>RMSE</th>\n",
       "      <th>Loss</th>\n",
       "      <th>RegLoss</th>\n",
       "      <th>LR</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>0.518220</td>\n",
       "      <td>0.618144</td>\n",
       "      <td>0.463509</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0</td>\n",
       "      <td>1.071776</td>\n",
       "      <td>1.369143</td>\n",
       "      <td>1.176725</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.002857</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>0.544104</td>\n",
       "      <td>0.619763</td>\n",
       "      <td>0.485463</td>\n",
       "      <td>0.0</td>\n",
       "      <td>1</td>\n",
       "      <td>0.551133</td>\n",
       "      <td>0.734627</td>\n",
       "      <td>0.364626</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.009130</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>0.479003</td>\n",
       "      <td>0.555191</td>\n",
       "      <td>0.394251</td>\n",
       "      <td>0.0</td>\n",
       "      <td>2</td>\n",
       "      <td>0.495316</td>\n",
       "      <td>0.666528</td>\n",
       "      <td>0.309311</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.009187</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>0.516385</td>\n",
       "      <td>0.592248</td>\n",
       "      <td>0.435629</td>\n",
       "      <td>0.0</td>\n",
       "      <td>3</td>\n",
       "      <td>0.481878</td>\n",
       "      <td>0.650643</td>\n",
       "      <td>0.295138</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.002914</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>0.492940</td>\n",
       "      <td>0.569359</td>\n",
       "      <td>0.405212</td>\n",
       "      <td>0.0</td>\n",
       "      <td>4</td>\n",
       "      <td>0.473522</td>\n",
       "      <td>0.639349</td>\n",
       "      <td>0.288111</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.001064</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>5</th>\n",
       "      <td>0.509749</td>\n",
       "      <td>0.587457</td>\n",
       "      <td>0.422531</td>\n",
       "      <td>0.0</td>\n",
       "      <td>5</td>\n",
       "      <td>0.471753</td>\n",
       "      <td>0.637636</td>\n",
       "      <td>0.286060</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000888</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>6</th>\n",
       "      <td>0.512940</td>\n",
       "      <td>0.592517</td>\n",
       "      <td>0.425102</td>\n",
       "      <td>0.0</td>\n",
       "      <td>6</td>\n",
       "      <td>0.470406</td>\n",
       "      <td>0.636353</td>\n",
       "      <td>0.284498</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000604</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>7</th>\n",
       "      <td>0.507922</td>\n",
       "      <td>0.586603</td>\n",
       "      <td>0.418404</td>\n",
       "      <td>0.0</td>\n",
       "      <td>7</td>\n",
       "      <td>0.470709</td>\n",
       "      <td>0.635788</td>\n",
       "      <td>0.283936</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000319</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>8</th>\n",
       "      <td>0.509402</td>\n",
       "      <td>0.588127</td>\n",
       "      <td>0.420135</td>\n",
       "      <td>0.0</td>\n",
       "      <td>8</td>\n",
       "      <td>0.469353</td>\n",
       "      <td>0.635285</td>\n",
       "      <td>0.282983</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000142</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>9</th>\n",
       "      <td>0.510809</td>\n",
       "      <td>0.589129</td>\n",
       "      <td>0.420723</td>\n",
       "      <td>0.0</td>\n",
       "      <td>9</td>\n",
       "      <td>0.468861</td>\n",
       "      <td>0.634873</td>\n",
       "      <td>0.283335</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.000141</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    MAE_val  RMSE_val  Loss_val  RegLoss_val  epoch       MAE      RMSE  \\\n",
       "0  0.518220  0.618144  0.463509          0.0      0  1.071776  1.369143   \n",
       "1  0.544104  0.619763  0.485463          0.0      1  0.551133  0.734627   \n",
       "2  0.479003  0.555191  0.394251          0.0      2  0.495316  0.666528   \n",
       "3  0.516385  0.592248  0.435629          0.0      3  0.481878  0.650643   \n",
       "4  0.492940  0.569359  0.405212          0.0      4  0.473522  0.639349   \n",
       "5  0.509749  0.587457  0.422531          0.0      5  0.471753  0.637636   \n",
       "6  0.512940  0.592517  0.425102          0.0      6  0.470406  0.636353   \n",
       "7  0.507922  0.586603  0.418404          0.0      7  0.470709  0.635788   \n",
       "8  0.509402  0.588127  0.420135          0.0      8  0.469353  0.635285   \n",
       "9  0.510809  0.589129  0.420723          0.0      9  0.468861  0.634873   \n",
       "\n",
       "       Loss  RegLoss        LR  \n",
       "0  1.176725      0.0  0.002857  \n",
       "1  0.364626      0.0  0.009130  \n",
       "2  0.309311      0.0  0.009187  \n",
       "3  0.295138      0.0  0.002914  \n",
       "4  0.288111      0.0  0.001064  \n",
       "5  0.286060      0.0  0.000888  \n",
       "6  0.284498      0.0  0.000604  \n",
       "7  0.283936      0.0  0.000319  \n",
       "8  0.282983      0.0  0.000142  \n",
       "9  0.283335      0.0  0.000141  "
      ]
     },
     "execution_count": 9,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "metrics"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n"
     ]
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.932% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.932% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.932% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Major frequency h corresponds to 99.932% of the data.\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/df_utils.py:1149: FutureWarning:\n",
      "\n",
      "Series.view is deprecated and will be removed in a future version. Use ``astype`` as an alternative to change the dtype.\n",
      "\n",
      "\n",
      "INFO - (NP.df_utils._infer_frequency) - Defined frequency is equal to major frequency - h\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning:\n",
      "\n",
      "To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "f1e4231ad84f4ce2a3b3152a04780df8",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Predicting: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/time_dataset.py:692: UserWarning:\n",
      "\n",
      "To copy construct from a tensor, it is recommended to use sourceTensor.clone().detach() or sourceTensor.clone().detach().requires_grad_(True), rather than torch.tensor(sourceTensor).\n",
      "\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "6eb4c8947cf94fceb753083bf4633d92",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "Predicting: |          | 0/? [00:00<?, ?it/s]"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "forecast = m.predict(df)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO - (NP.forecaster.plot) - Plotting data from ID test\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:100: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "a7458da38e7d4fe88012eb289b1bcf6e",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "FigureWidgetResampler({\n",
       "    'data': [{'fillcolor': 'rgba(45, 146, 255, 0.2)',\n",
       "              'line': {'color': 'rgba(45, 146, 255, 0.2)', 'width': 1},\n",
       "              'mode': 'lines',\n",
       "              'name': '<b style=\"color:sandybrown\">[R]</b> yhat5 1.0% <i style=\"color:#fc9944\">~1h</i>',\n",
       "              'type': 'scatter',\n",
       "              'uid': '1e485c1d-dae9-439f-97e8-f8960bf19265',\n",
       "              'x': array([datetime.datetime(2015, 1, 2, 13, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 14, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 15, 0), ...,\n",
       "                          datetime.datetime(2015, 3, 2, 17, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 18, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 20, 0)], dtype=object),\n",
       "              'y': array([-8.401451, -8.331238, -7.641697, ..., 35.0834  , 31.378742, 26.125694],\n",
       "                         dtype=float32)},\n",
       "             {'fill': 'tonexty',\n",
       "              'fillcolor': 'rgba(45, 146, 255, 0.2)',\n",
       "              'line': {'color': 'rgba(45, 146, 255, 0.2)', 'width': 1},\n",
       "              'mode': 'lines',\n",
       "              'name': '<b style=\"color:sandybrown\">[R]</b> yhat5 99.0% <i style=\"color:#fc9944\">~1h</i>',\n",
       "              'type': 'scatter',\n",
       "              'uid': 'ddeebab6-2948-4ed2-839d-80f25bcbbb46',\n",
       "              'x': array([datetime.datetime(2015, 1, 2, 13, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 14, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 15, 0), ...,\n",
       "                          datetime.datetime(2015, 3, 2, 17, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 18, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 20, 0)], dtype=object),\n",
       "              'y': array([70.66735 , 76.33557 , 73.91716 , ..., 72.79848 , 76.60592 , 75.965355],\n",
       "                         dtype=float32)},\n",
       "             {'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': '<b style=\"color:sandybrown\">[R]</b> Predicted <i style=\"color:#fc9944\">~1h</i>',\n",
       "              'type': 'scatter',\n",
       "              'uid': '3979d61f-ad4c-49eb-92f2-0519eec19b62',\n",
       "              'x': array([datetime.datetime(2015, 1, 2, 13, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 14, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 15, 0), ...,\n",
       "                          datetime.datetime(2015, 3, 2, 17, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 19, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 20, 0)], dtype=object),\n",
       "              'y': array([39.514854, 43.52948 , 40.765232, ..., 61.876595, 65.44407 , 61.56613 ],\n",
       "                         dtype=float32)},\n",
       "             {'marker': {'color': 'blue', 'size': 4, 'symbol': 'x'},\n",
       "              'mode': 'markers',\n",
       "              'name': '<b style=\"color:sandybrown\">[R]</b> Predicted <i style=\"color:#fc9944\">~1h</i>',\n",
       "              'type': 'scatter',\n",
       "              'uid': 'b8c0ed1f-761f-44db-a774-93abc8ab8338',\n",
       "              'x': array([datetime.datetime(2015, 1, 2, 13, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 14, 0),\n",
       "                          datetime.datetime(2015, 1, 2, 15, 0), ...,\n",
       "                          datetime.datetime(2015, 3, 2, 17, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 19, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 20, 0)], dtype=object),\n",
       "              'y': array([39.514854, 43.52948 , 40.765232, ..., 61.876595, 65.44407 , 61.56613 ],\n",
       "                         dtype=float32)},\n",
       "             {'marker': {'color': 'black', 'size': 4},\n",
       "              'mode': 'markers',\n",
       "              'name': '<b style=\"color:sandybrown\">[R]</b> Actual <i style=\"color:#fc9944\">~1h</i>',\n",
       "              'type': 'scatter',\n",
       "              'uid': '46d51f13-dea8-4bc0-b1fa-e458374a0cbc',\n",
       "              'x': array([datetime.datetime(2015, 1, 1, 0, 0),\n",
       "                          datetime.datetime(2015, 1, 1, 1, 0),\n",
       "                          datetime.datetime(2015, 1, 1, 2, 0), ...,\n",
       "                          datetime.datetime(2015, 3, 2, 17, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 18, 0),\n",
       "                          datetime.datetime(2015, 3, 2, 20, 0)], dtype=object),\n",
       "              'y': array([64.92, 58.46, 63.35, ..., 68.61, 60.22, 60.32])}],\n",
       "    'layout': {'autosize': True,\n",
       "               'font': {'size': 10},\n",
       "               'height': 420,\n",
       "               'hovermode': 'x unified',\n",
       "               'margin': {'b': 0, 'l': 0, 'pad': 0, 'r': 10, 't': 10},\n",
       "               'showlegend': True,\n",
       "               'template': '...',\n",
       "               'title': {'font': {'size': 12}},\n",
       "               'width': 700,\n",
       "               'xaxis': {'linewidth': 1.5,\n",
       "                         'mirror': True,\n",
       "                         'rangeselector': {'buttons': [{'count': 7, 'label': '1w', 'step': 'day', 'stepmode': 'backward'},\n",
       "                                                       {'count': 1,\n",
       "                                                        'label': '1m',\n",
       "                                                        'step': 'month',\n",
       "                                                        'stepmode': 'backward'},\n",
       "                                                       {'count': 6,\n",
       "                                                        'label': '6m',\n",
       "                                                        'step': 'month',\n",
       "                                                        'stepmode': 'backward'},\n",
       "                                                       {'count': 1, 'label': '1y', 'step': 'year', 'stepmode': 'backward'},\n",
       "                                                       {'step': 'all'}]},\n",
       "                         'rangeslider': {'visible': True},\n",
       "                         'showline': True,\n",
       "                         'title': {'text': 'ds'},\n",
       "                         'type': 'date'},\n",
       "               'yaxis': {'linewidth': 1.5, 'mirror': True, 'showline': True, 'title': {'text': 'y'}}}\n",
       "})"
      ]
     },
     "execution_count": 11,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m.highlight_nth_step_ahead_of_each_forecast(m.config_model.n_forecasts)\n",
    "m.plot(forecast, df_name=\"test\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "INFO - (NP.forecaster.plot_components) - Plotting data from ID test\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:410: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:177: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version. Please use 'h' instead of 'H'.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/.cache/pypoetry/virtualenvs/neuralprophet-CT7lk1Bv-py3.10/lib/python3.10/site-packages/plotly_resampler/figure_resampler/utils.py:178: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:559: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n"
     ]
    },
    {
     "ename": "IndexError",
     "evalue": "index -1 is out of bounds for axis 0 with size 0",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mIndexError\u001b[0m                                Traceback (most recent call last)",
      "Cell \u001b[0;32mIn[12], line 1\u001b[0m\n\u001b[0;32m----> 1\u001b[0m \u001b[43mm\u001b[49m\u001b[38;5;241;43m.\u001b[39;49m\u001b[43mplot_components\u001b[49m\u001b[43m(\u001b[49m\u001b[43mforecast\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[43mdf_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mtest\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m)\u001b[49m\n",
      "File \u001b[0;32m~/github/neural_prophet/neuralprophet/forecaster.py:2465\u001b[0m, in \u001b[0;36mNeuralProphet.plot_components\u001b[0;34m(self, fcst, df_name, figsize, forecast_in_focus, plotting_backend, components, one_period_per_season)\u001b[0m\n\u001b[1;32m   2463\u001b[0m log_warning_deprecation_plotly(plotting_backend)\n\u001b[1;32m   2464\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m plotting_backend\u001b[38;5;241m.\u001b[39mstartswith(\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mplotly\u001b[39m\u001b[38;5;124m\"\u001b[39m):\n\u001b[0;32m-> 2465\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m \u001b[43mplot_components_plotly\u001b[49m\u001b[43m(\u001b[49m\n\u001b[1;32m   2466\u001b[0m \u001b[43m        \u001b[49m\u001b[43mm\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mself\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2467\u001b[0m \u001b[43m        \u001b[49m\u001b[43mfcst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfcst\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2468\u001b[0m \u001b[43m        \u001b[49m\u001b[43mplot_configuration\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mvalid_plot_configuration\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2469\u001b[0m \u001b[43m        \u001b[49m\u001b[43mfigsize\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[38;5;28;43mtuple\u001b[39;49m\u001b[43m(\u001b[49m\u001b[43mx\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;241;43m70\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mfor\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mx\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;129;43;01min\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfigsize\u001b[49m\u001b[43m)\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01mif\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43mfigsize\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;28;43;01melse\u001b[39;49;00m\u001b[43m \u001b[49m\u001b[43m(\u001b[49m\u001b[38;5;241;43m700\u001b[39;49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m210\u001b[39;49m\u001b[43m)\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2470\u001b[0m \u001b[43m        \u001b[49m\u001b[43mdf_name\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mdf_name\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2471\u001b[0m \u001b[43m        \u001b[49m\u001b[43mone_period_per_season\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mone_period_per_season\u001b[49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2472\u001b[0m \u001b[43m        \u001b[49m\u001b[43mresampler_active\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mplotting_backend\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m==\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mplotly-resampler\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2473\u001b[0m \u001b[43m        \u001b[49m\u001b[43mplotly_static\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mplotting_backend\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m==\u001b[39;49m\u001b[43m \u001b[49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[38;5;124;43mplotly-static\u001b[39;49m\u001b[38;5;124;43m\"\u001b[39;49m\u001b[43m,\u001b[49m\n\u001b[1;32m   2474\u001b[0m \u001b[43m    \u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m   2475\u001b[0m \u001b[38;5;28;01melse\u001b[39;00m:\n\u001b[1;32m   2476\u001b[0m     \u001b[38;5;28;01mreturn\u001b[39;00m plot_components(\n\u001b[1;32m   2477\u001b[0m         m\u001b[38;5;241m=\u001b[39m\u001b[38;5;28mself\u001b[39m,\n\u001b[1;32m   2478\u001b[0m         fcst\u001b[38;5;241m=\u001b[39mfcst,\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m   2483\u001b[0m         one_period_per_season\u001b[38;5;241m=\u001b[39mone_period_per_season,\n\u001b[1;32m   2484\u001b[0m     )\n",
      "File \u001b[0;32m~/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:332\u001b[0m, in \u001b[0;36mplot_components\u001b[0;34m(m, fcst, plot_configuration, df_name, one_period_per_season, figsize, resampler_active, plotly_static)\u001b[0m\n\u001b[1;32m    327\u001b[0m         trace_object \u001b[38;5;241m=\u001b[39m get_forecast_component_props(\n\u001b[1;32m    328\u001b[0m             fcst\u001b[38;5;241m=\u001b[39mfcst, df_name\u001b[38;5;241m=\u001b[39mdf_name, comp_name\u001b[38;5;241m=\u001b[39mcomp_name, plot_name\u001b[38;5;241m=\u001b[39mcomp[\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mplot_name\u001b[39m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m    329\u001b[0m         )\n\u001b[1;32m    331\u001b[0m \u001b[38;5;28;01melif\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mauto-regression\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m name \u001b[38;5;129;01mor\u001b[39;00m \u001b[38;5;124m\"\u001b[39m\u001b[38;5;124mlagged regressor\u001b[39m\u001b[38;5;124m\"\u001b[39m \u001b[38;5;129;01min\u001b[39;00m name:\n\u001b[0;32m--> 332\u001b[0m     trace_object \u001b[38;5;241m=\u001b[39m \u001b[43mget_multiforecast_component_props\u001b[49m\u001b[43m(\u001b[49m\u001b[43mfcst\u001b[49m\u001b[38;5;241;43m=\u001b[39;49m\u001b[43mfcst\u001b[49m\u001b[43m,\u001b[49m\u001b[43m \u001b[49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[38;5;241;43m*\u001b[39;49m\u001b[43mcomp\u001b[49m\u001b[43m)\u001b[49m\n\u001b[1;32m    333\u001b[0m     fig\u001b[38;5;241m.\u001b[39mupdate_layout(barmode\u001b[38;5;241m=\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;124moverlay\u001b[39m\u001b[38;5;124m\"\u001b[39m)\n\u001b[1;32m    335\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m j \u001b[38;5;241m==\u001b[39m \u001b[38;5;241m0\u001b[39m:\n",
      "File \u001b[0;32m~/github/neural_prophet/neuralprophet/plot_forecast_plotly.py:603\u001b[0m, in \u001b[0;36mget_multiforecast_component_props\u001b[0;34m(fcst, comp_name, plot_name, multiplicative, bar, focus, num_overplot, **kwargs)\u001b[0m\n\u001b[1;32m    601\u001b[0m y \u001b[38;5;241m=\u001b[39m fcst[\u001b[38;5;124mf\u001b[39m\u001b[38;5;124m\"\u001b[39m\u001b[38;5;132;01m{\u001b[39;00mcomp_name\u001b[38;5;132;01m}\u001b[39;00m\u001b[38;5;124m\"\u001b[39m]\n\u001b[1;32m    602\u001b[0m y \u001b[38;5;241m=\u001b[39m y\u001b[38;5;241m.\u001b[39mvalues\n\u001b[0;32m--> 603\u001b[0m \u001b[43my\u001b[49m\u001b[43m[\u001b[49m\u001b[38;5;241;43m-\u001b[39;49m\u001b[38;5;241;43m1\u001b[39;49m\u001b[43m]\u001b[49m \u001b[38;5;241m=\u001b[39m \u001b[38;5;241m0\u001b[39m\n\u001b[1;32m    604\u001b[0m \u001b[38;5;28;01mif\u001b[39;00m bar:\n\u001b[1;32m    605\u001b[0m     traces\u001b[38;5;241m.\u001b[39mappend(\n\u001b[1;32m    606\u001b[0m         go\u001b[38;5;241m.\u001b[39mBar(\n\u001b[1;32m    607\u001b[0m             name\u001b[38;5;241m=\u001b[39mplot_name,\n\u001b[0;32m   (...)\u001b[0m\n\u001b[1;32m    613\u001b[0m         )\n\u001b[1;32m    614\u001b[0m     )\n",
      "\u001b[0;31mIndexError\u001b[0m: index -1 is out of bounds for axis 0 with size 0"
     ]
    }
   ],
   "source": [
    "m.plot_components(forecast, df_name=\"test\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [
    {
     "name": "stderr",
     "output_type": "stream",
     "text": [
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_model_parameters_plotly.py:178: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_model_parameters_plotly.py:475: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_model_parameters_plotly.py:508: FutureWarning:\n",
      "\n",
      "The behavior of DatetimeProperties.to_pydatetime is deprecated, in a future version this will return a Series containing python datetime objects instead of an ndarray. To retain the old behavior, call `np.array` on the result\n",
      "\n",
      "\n",
      "WARNING - (py.warnings._showwarnmsg) - /home/tabletop/github/neural_prophet/neuralprophet/plot_model_parameters_plotly.py:564: FutureWarning:\n",
      "\n",
      "'H' is deprecated and will be removed in a future version, please use 'h' instead.\n",
      "\n",
      "\n"
     ]
    },
    {
     "data": {
      "application/vnd.jupyter.widget-view+json": {
       "model_id": "4549df8821ee4b649e748ccf20cbb9a9",
       "version_major": 2,
       "version_minor": 0
      },
      "text/plain": [
       "FigureWidgetResampler({\n",
       "    'data': [{'fill': 'none',\n",
       "              'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': 'Trend',\n",
       "              'type': 'scatter',\n",
       "              'uid': 'a87ad6c0-8302-4d80-a053-3de55909d7d9',\n",
       "              'x': array([datetime.datetime(2015, 1, 1, 0, 0),\n",
       "                          datetime.datetime(2015, 2, 28, 23, 0)], dtype=object),\n",
       "              'xaxis': 'x',\n",
       "              'y': array([44.171093, 46.755657], dtype=float32),\n",
       "              'yaxis': 'y'},\n",
       "             {'fill': 'none',\n",
       "              'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': 'yearly',\n",
       "              'type': 'scatter',\n",
       "              'uid': '687528c8-278a-4dba-a432-7580315842b3',\n",
       "              'x': array([datetime.datetime(2017, 1, 1, 0, 0),\n",
       "                          datetime.datetime(2017, 1, 2, 0, 0),\n",
       "                          datetime.datetime(2017, 1, 3, 0, 0), ...,\n",
       "                          datetime.datetime(2017, 12, 29, 0, 0),\n",
       "                          datetime.datetime(2017, 12, 30, 0, 0),\n",
       "                          datetime.datetime(2017, 12, 31, 0, 0)], dtype=object),\n",
       "              'xaxis': 'x2',\n",
       "              'y': array([3.5837142, 3.9962187, 4.3687215, ..., 2.132554 , 2.5801535, 3.0329647],\n",
       "                         dtype=float32),\n",
       "              'yaxis': 'y2'},\n",
       "             {'fill': 'none',\n",
       "              'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': 'weekly',\n",
       "              'type': 'scatter',\n",
       "              'uid': '9bc616f5-17ad-4fc4-b88f-bb47bdcc4e5f',\n",
       "              'x': array([  0,   1,   2,   3,   4,   5,   6,   7,   8,   9,  10,  11,  12,  13,\n",
       "                           14,  15,  16,  17,  18,  19,  20,  21,  22,  23,  24,  25,  26,  27,\n",
       "                           28,  29,  30,  31,  32,  33,  34,  35,  36,  37,  38,  39,  40,  41,\n",
       "                           42,  43,  44,  45,  46,  47,  48,  49,  50,  51,  52,  53,  54,  55,\n",
       "                           56,  57,  58,  59,  60,  61,  62,  63,  64,  65,  66,  67,  68,  69,\n",
       "                           70,  71,  72,  73,  74,  75,  76,  77,  78,  79,  80,  81,  82,  83,\n",
       "                           84,  85,  86,  87,  88,  89,  90,  91,  92,  93,  94,  95,  96,  97,\n",
       "                           98,  99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111,\n",
       "                          112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125,\n",
       "                          126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139,\n",
       "                          140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153,\n",
       "                          154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 165, 166, 167]),\n",
       "              'xaxis': 'x3',\n",
       "              'y': array([  3.6775422 ,   3.4448764 ,   3.1795988 ,   2.856169  ,   2.5034661 ,\n",
       "                            2.132053  ,   1.7310926 ,   1.3034438 ,   0.8253559 ,   0.36245304,\n",
       "                           -0.12688631,  -0.6307145 ,  -1.1616575 ,  -1.7126511 ,  -2.2267792 ,\n",
       "                           -2.7566912 ,  -3.2863293 ,  -3.8237705 ,  -4.32482   ,  -4.836178  ,\n",
       "                           -5.361228  ,  -5.8546944 ,  -6.334524  ,  -6.7697473 ,  -7.2097106 ,\n",
       "                           -7.6307163 ,  -8.015902  ,  -8.410988  ,  -8.759339  ,  -9.097741  ,\n",
       "                           -9.40439   ,  -9.673478  ,  -9.938627  , -10.160235  , -10.360814  ,\n",
       "                          -10.533252  , -10.672475  , -10.790765  , -10.871719  , -10.92612   ,\n",
       "                          -10.949665  , -10.941065  , -10.902167  , -10.831596  , -10.7297535 ,\n",
       "                          -10.584343  , -10.400615  , -10.213366  ,  -9.973349  ,  -9.703287  ,\n",
       "                           -9.400256  ,  -9.039257  ,  -8.638971  ,  -8.218772  ,  -7.76986   ,\n",
       "                           -7.29001   ,  -6.7592626 ,  -6.205373  ,  -5.610344  ,  -5.011173  ,\n",
       "                           -4.306703  ,  -3.6050465 ,  -2.8899956 ,  -2.1421108 ,  -1.3980246 ,\n",
       "                           -0.55479425,   0.25694594,   1.0867394 ,   1.9551147 ,   2.7880616 ,\n",
       "                            3.6983426 ,   4.5652947 ,   5.432634  ,   6.2935643 ,   7.1280026 ,\n",
       "                            7.9856586 ,   8.809366  ,   9.650012  ,  10.417858  ,  11.145185  ,\n",
       "                           11.858826  ,  12.523886  ,  13.137134  ,  13.699438  ,  14.241183  ,\n",
       "                           14.707007  ,  15.098125  ,  15.426196  ,  15.693906  ,  15.901334  ,\n",
       "                           16.017977  ,  16.07477   ,  16.05878   ,  15.968486  ,  15.792491  ,\n",
       "                           15.547381  ,  15.236185  ,  14.865028  ,  14.416378  ,  13.873076  ,\n",
       "                           13.277334  ,  12.638401  ,  11.962018  ,  11.21623   ,  10.383526  ,\n",
       "                            9.558632  ,   8.688934  ,   7.814783  ,   6.8657885 ,   5.8782206 ,\n",
       "                            4.93936   ,   3.9818935 ,   3.0527442 ,   2.0779295 ,   1.1511891 ,\n",
       "                            0.24442616,  -0.68556976,  -1.5159744 ,  -2.3555033 ,  -3.1236107 ,\n",
       "                           -3.845236  ,  -4.5020337 ,  -5.122622  ,  -5.7106447 ,  -6.2054214 ,\n",
       "                           -6.647813  ,  -7.003909  ,  -7.302908  ,  -7.544511  ,  -7.7055807 ,\n",
       "                           -7.7959027 ,  -7.8254924 ,  -7.783019  ,  -7.673332  ,  -7.5097384 ,\n",
       "                           -7.290905  ,  -7.017191  ,  -6.67524   ,  -6.2961516 ,  -5.888133  ,\n",
       "                           -5.437577  ,  -4.9315596 ,  -4.396648  ,  -3.855047  ,  -3.313541  ,\n",
       "                           -2.7510498 ,  -2.1820972 ,  -1.5792464 ,  -0.9815789 ,  -0.42582962,\n",
       "                            0.10404018,   0.6269935 ,   1.1417981 ,   1.6131238 ,   2.0423858 ,\n",
       "                            2.4490814 ,   2.8360126 ,   3.1679304 ,   3.4505346 ,   3.676464  ,\n",
       "                            3.8737729 ,   4.024116  ,   4.1148095 ,   4.157773  ,   4.150377  ,\n",
       "                            4.109914  ,   4.006662  ,   3.8584704 ], dtype=float32),\n",
       "              'yaxis': 'y3'},\n",
       "             {'fill': 'none',\n",
       "              'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': 'winter',\n",
       "              'type': 'scatter',\n",
       "              'uid': '4495dca3-32d1-4ba1-8c78-6e1a1b0af24c',\n",
       "              'x': array([  0,   1,   2, ..., 285, 286, 287]),\n",
       "              'xaxis': 'x4',\n",
       "              'y': array([ 0.96416605, -0.55186653, -1.687766  , ...,  3.8534515 ,  3.2716925 ,\n",
       "                           2.1252832 ], dtype=float32),\n",
       "              'yaxis': 'y4'},\n",
       "             {'fill': 'none',\n",
       "              'line': {'color': '#2d92ff', 'width': 2},\n",
       "              'mode': 'lines',\n",
       "              'name': 'summer',\n",
       "              'type': 'scatter',\n",
       "              'uid': 'cceb9a1a-bc38-482b-a7d5-82b72a93a298',\n",
       "              'x': array([  0,   1,   2, ..., 285, 286, 287]),\n",
       "              'xaxis': 'x5',\n",
       "              'y': array([-5.745831 , -5.2108707, -4.672284 , ..., -6.2985435, -6.2671404,\n",
       "                          -6.0654645], dtype=float32),\n",
       "              'yaxis': 'y5'},\n",
       "             {'marker': {'color': '#2d92ff'},\n",
       "              'name': 'AR',\n",
       "              'type': 'bar',\n",
       "              'uid': 'fc2e7ac5-066d-48a0-8e16-b80235e12bfe',\n",
       "              'width': 0.8,\n",
       "              'x': array([10,  9,  8,  7,  6,  5,  4,  3,  2,  1]),\n",
       "              'xaxis': 'x6',\n",
       "              'y': array([0., 0., 0., 0., 0., 0., 0., 0., 0., 0.], dtype=float32),\n",
       "              'yaxis': 'y6'},\n",
       "             {'marker': {'color': '#2d92ff'},\n",
       "              'name': 'Lagged Regressor \"temp\"',\n",
       "              'type': 'bar',\n",
       "              'uid': '6a963e5b-a63f-45bf-ae7f-1fa296e6f623',\n",
       "              'width': 0.8,\n",
       "              'x': array([33, 32, 31, 30, 29, 28, 27, 26, 25, 24, 23, 22, 21, 20, 19, 18, 17, 16,\n",
       "                          15, 14, 13, 12, 11, 10,  9,  8,  7,  6,  5,  4,  3,  2,  1]),\n",
       "              'xaxis': 'x7',\n",
       "              'y': array([-2.3441856e-01, -7.4248093e-01,  1.3433978e-01,  4.7361168e-01,\n",
       "                           4.8439783e-01,  2.8078523e-01, -1.9517194e-01,  2.2985543e-01,\n",
       "                           1.5531473e-01, -4.2631316e-01,  5.0868553e-01,  1.1522221e-01,\n",
       "                          -4.8527386e-02,  2.0242128e-01,  4.4463417e-03, -2.3070528e-01,\n",
       "                           1.7045366e-02, -8.4169136e-05,  1.5831508e-01, -2.2444238e-01,\n",
       "                           1.4253077e-01, -2.9090768e-02, -1.4969027e-01,  3.8341036e-01,\n",
       "                          -1.2710637e-01, -1.4844303e-01,  1.1406808e-01, -2.2177878e-01,\n",
       "                           2.8057915e-01, -3.3217099e-01, -1.6262497e-01, -3.2851827e-01,\n",
       "                          -1.3853197e-01], dtype=float32),\n",
       "              'yaxis': 'y7'},\n",
       "             {'marker': {'color': '#2d92ff'},\n",
       "              'name': 'Additive event',\n",
       "              'type': 'bar',\n",
       "              'uid': 'f045a98c-7b21-4761-b615-bc9edab8575b',\n",
       "              'width': 0.8,\n",
       "              'x': array([\"Washington's Birthday_+0\", \"Washington's Birthday_+1\",\n",
       "                          \"Washington's Birthday_-1\", 'Thanksgiving_+0', 'Thanksgiving_+1',\n",
       "                          'Thanksgiving_-1', 'Labor Day_+0', 'Labor Day_+1', 'Labor Day_-1',\n",
       "                          'Veterans Day_+0', 'Veterans Day_+1', 'Veterans Day_-1',\n",
       "                          \"New Year's Day_+0\", \"New Year's Day_+1\", \"New Year's Day_-1\",\n",
       "                          'Independence Day_+0', 'Independence Day_+1', 'Independence Day_-1',\n",
       "                          'Martin Luther King Jr. Day_+0', 'Martin Luther King Jr. Day_+1',\n",
       "                          'Martin Luther King Jr. Day_-1', 'Memorial Day_+0', 'Memorial Day_+1',\n",
       "                          'Memorial Day_-1', 'Columbus Day_+0', 'Columbus Day_+1',\n",
       "                          'Columbus Day_-1', 'Christmas Day_+0', 'Christmas Day_+1',\n",
       "                          'Christmas Day_-1'], dtype=object),\n",
       "              'xaxis': 'x8',\n",
       "              'y': [-5.999994277954102, 0.15511037409305573, -0.6804019212722778,\n",
       "                    -0.8969926834106445, -4.350093841552734, 2.10798978805542,\n",
       "                    -4.097671031951904, 5.030608177185059, 3.1227762699127197,\n",
       "                    3.44264817237854, 4.6125640869140625, 0.7293226718902588,\n",
       "                    2.7135281562805176, -0.2420026659965515, 4.3908257484436035,\n",
       "                    -7.856958866119385, -5.952345848083496, 5.613704204559326,\n",
       "                    -7.10869026184082, -2.1775100231170654, 2.4739584922790527,\n",
       "                    0.04653293639421463, 1.881555438041687, -0.2442491501569748,\n",
       "                    1.7328133583068848, 3.332047462463379, -4.845430850982666,\n",
       "                    0.990510880947113, 3.7318599224090576, -1.215183973312378],\n",
       "              'yaxis': 'y8'}],\n",
       "    'layout': {'autosize': True,\n",
       "               'font': {'size': 10},\n",
       "               'height': 1680,\n",
       "               'hovermode': 'x unified',\n",
       "               'margin': {'b': 0, 'l': 0, 'pad': 0, 'r': 10, 't': 10},\n",
       "               'showlegend': False,\n",
       "               'template': '...',\n",
       "               'title': {'font': {'size': 12}},\n",
       "               'width': 700,\n",
       "               'xaxis': {'anchor': 'y',\n",
       "                         'domain': [0.0, 1.0],\n",
       "                         'linewidth': 1.5,\n",
       "                         'mirror': True,\n",
       "                         'range': [2014-12-29 00:00:00, 2015-03-03 00:00:00],\n",
       "                         'showline': True,\n",
       "                         'title': {'text': 'ds'},\n",
       "                         'type': 'date'},\n",
       "               'xaxis2': {'anchor': 'y2',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [2016-12-14 00:00:00, 2018-01-18 00:00:00],\n",
       "                          'showline': True,\n",
       "                          'tickformat': '%B %e',\n",
       "                          'title': {'text': 'Day of year'}},\n",
       "               'xaxis3': {'anchor': 'y3',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [-8, 175],\n",
       "                          'showline': True,\n",
       "                          'tickmode': 'array',\n",
       "                          'ticktext': [Sunday, Monday, Tuesday, Wednesday,\n",
       "                                       Thursday, Friday, Saturday, Sunday, Sunday],\n",
       "                          'tickvals': [0, 24, 48, 72, 96, 120, 144, 168, 192],\n",
       "                          'title': {'text': 'Day of week'}},\n",
       "               'xaxis4': {'anchor': 'y4',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [-14, 301],\n",
       "                          'showline': True,\n",
       "                          'tickmode': 'array',\n",
       "                          'ticktext': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n",
       "                                       13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,\n",
       "                                       24],\n",
       "                          'tickvals': [0, 12, 24, 36, 48, 60, 72, 84, 96, 108,\n",
       "                                       120, 132, 144, 156, 168, 180, 192, 204, 216,\n",
       "                                       228, 240, 252, 264, 276, 288],\n",
       "                          'title': {'text': 'Hour of day'}},\n",
       "               'xaxis5': {'anchor': 'y5',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [-14, 301],\n",
       "                          'showline': True,\n",
       "                          'tickmode': 'array',\n",
       "                          'ticktext': [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12,\n",
       "                                       13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23,\n",
       "                                       24],\n",
       "                          'tickvals': [0, 12, 24, 36, 48, 60, 72, 84, 96, 108,\n",
       "                                       120, 132, 144, 156, 168, 180, 192, 204, 216,\n",
       "                                       228, 240, 252, 264, 276, 288],\n",
       "                          'title': {'text': 'Hour of day'}},\n",
       "               'xaxis6': {'anchor': 'y6',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [0, 11],\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'AR lag number'}},\n",
       "               'xaxis7': {'anchor': 'y7',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'range': [-2, 36],\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Lagged Regressor \"temp\" lag number'}},\n",
       "               'xaxis8': {'anchor': 'y8',\n",
       "                          'domain': [0.0, 1.0],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Additive event name'}},\n",
       "               'yaxis': {'anchor': 'x',\n",
       "                         'domain': [0.9078124999999999, 0.9999999999999999],\n",
       "                         'linewidth': 1.5,\n",
       "                         'mirror': True,\n",
       "                         'rangemode': 'normal',\n",
       "                         'showline': True,\n",
       "                         'title': {'text': 'Trend'}},\n",
       "               'yaxis2': {'anchor': 'x2',\n",
       "                          'domain': [0.778125, 0.8703124999999999],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Seasonality: yearly'}},\n",
       "               'yaxis3': {'anchor': 'x3',\n",
       "                          'domain': [0.6484375, 0.740625],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Seasonality: weekly'}},\n",
       "               'yaxis4': {'anchor': 'x4',\n",
       "                          'domain': [0.51875, 0.6109375],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Seasonality: winter'}},\n",
       "               'yaxis5': {'anchor': 'x5',\n",
       "                          'domain': [0.38906250000000003, 0.48125000000000007],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Seasonality: summer'}},\n",
       "               'yaxis6': {'anchor': 'x6',\n",
       "                          'domain': [0.259375, 0.3515625],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'AR weight (5)-ahead'}},\n",
       "               'yaxis7': {'anchor': 'x7',\n",
       "                          'domain': [0.1296875, 0.22187500000000002],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Lagged Regressor \"temp\" weight (5)-ahead'}},\n",
       "               'yaxis8': {'anchor': 'x8',\n",
       "                          'domain': [0.0, 0.0921875],\n",
       "                          'linewidth': 1.5,\n",
       "                          'mirror': True,\n",
       "                          'rangemode': 'normal',\n",
       "                          'showline': True,\n",
       "                          'title': {'text': 'Additive event weight'}}}\n",
       "})"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "m.plot_parameters()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.12"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
